package com.roadjava.rbac.enums;


public enum SexEnum {
    M("男"),
    F("女");
    private final String desc;
    SexEnum(String desc) {
        this.desc = desc;
    }

    /**
     * 通过枚举对象的名字获取对应的描述
     */
    public static String getDescByName(String name) {
        for (SexEnum e : values()) {
            if (e.name().equals(name)) {
                return e.desc;
            }
        }
        return null;
    }
}
